package com.kitemap.view {
	import lt.uza.utils.Global;		import com.kitemap.KitemapApplication;		import mx.containers.Canvas;	import mx.controls.List;	
	public class MouseWheel extends Canvas
	{
		[Bindable]
		protected var quoteInPieces:Array = ["I", "made", "this", "letter", "longer", "than", "usual", "because", "I", "lack", "the", "time", "to", "make", "it", "short.", "(Blaise Pascal)"];

		// In MXML
		public var listBox:List;

		public function MouseWheel()
		{
			super();
		}
		
		override public function set visible(state:Boolean):void
		{
			super.visible = state;			trace("MouseWheel::set visible");

			var app:KitemapApplication = (Global.getInstance().application) as KitemapApplication;

			// Setup mouse wheel support on OS X for list box.
			if (state)
			{
				// Register the list box to receive mouse wheel events.
				app.mouseWheelSupport.registerObject(listBox);				trace("We've added support for the list box");
			}
			else
			{
				// Unregister the list box.
				if (listBox != null)
				{
					app.mouseWheelSupport.unRegisterObject(listBox);
					trace("We've removed support for the list box");
				}
			}
		}
		
	}
}